function [num, den]= D68L8D_tf(wc)
% Builds the transfer function of the Frequency Devices D68L8D module
%
% [N,D] = D68L8D_tf(WC) creates the coefficients of the transfer function with
%        cut-off frequency WC rad/s. N returns the numerator coefficients in
%        descending powers of s. D returns the denominator coefficients in descending
%        powers of s.
%
%        To convert N and D into a transfer function object use the following, for
%        example, SYS = tf(N,D)

Wp = [1.056 1.088 1.160 1.300] * wc;
Q  = [0.5060 0.5596 0.7109 1.2257];
Wz = [3.7831 0.8909 5.3476] * wc;

K = prod(Wp)^2/(-prod(Wz)^2);

% Build the denominator

den = 1;
for i = 1 : length(Wp)
  den = conv(den, [1 (Wp(i)/Q(i)) Wp(i)^2]);
end

% Build the numerator
num = K;
num = conv(num, [1 0 Wz(1)^2]);
num = conv(num, [1 0 -Wz(2)^2]);
num = conv(num, [1 0 Wz(3)^2]);